//
//  B_TwoButtonAlertView.m
//  Application
//
//  Created by 薛小刚 on 2018/8/10.
//  Copyright © 2018年 薛小刚. All rights reserved.
//

#import "B_TwoButtonAlertView.h"

@implementation B_TwoButtonAlertView

+ (instancetype) initB_TwoButtonAlertView {
    return [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil].lastObject;
}

- (void) show {
    [[UIApplication sharedApplication].keyWindow addSubview:self];
    [self mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(KeyWindow.mas_top);
        make.left.equalTo(KeyWindow.mas_left);
        make.right.equalTo(KeyWindow.mas_right);
        make.bottom.equalTo(KeyWindow.mas_bottom);
    }];
}


- (IBAction)B_LeftButtonAction:(id)sender {
    [self removeFromSuperview];
    if (self.leftAction) {
        self.leftAction(sender);
    }
}

- (IBAction)B_RightButtonAction:(id)sender {
    [self removeFromSuperview];
    if (self.rightAction) {
        self.rightAction(sender);
    }
}
@end
